using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Collections.ObjectModel;

namespace BodySoundSimulator.AbsoluteMapData
{
	public class SoundMapData
	{
		#region Fields
		Collection<float> frontViewGridXCoordinates;
		Collection<float> frontViewGridYCoordinates;
		Collection<float> backViewGridXCoordinates;
		Collection<float> backViewGridYCoordinates;
		Collection<FrontViewDynamicContributionData> frontViewContributionMap;
		Collection<BackViewDynamicContributionData> backViewContributionMap;
		#endregion

		#region Properties
		public Collection<float> FrontViewGridXCoordinates
		{
			get { return frontViewGridXCoordinates; }
			set { frontViewGridXCoordinates = value; }
		}

		public Collection<float> FrontViewGridYCoordinates
		{
			get { return frontViewGridYCoordinates; }
			set { frontViewGridYCoordinates = value; }
		}

		public Collection<float> BackViewGridXCoordinates
		{
			get { return backViewGridXCoordinates; }
			set { backViewGridXCoordinates = value; }
		}

		public Collection<float> BackViewGridYCoordinates
		{
			get { return backViewGridYCoordinates; }
			set { backViewGridYCoordinates = value; }
		}

		public Collection<FrontViewDynamicContributionData> FrontViewContributionMap
		{
			get { return frontViewContributionMap; }
			set { frontViewContributionMap = value; }
		}

		public Collection<BackViewDynamicContributionData> BackViewContributionMap
		{
			get { return backViewContributionMap; }
			set { backViewContributionMap = value; }
		}
		#endregion

		#region Constructors
		public SoundMapData()
		{
			this.frontViewGridXCoordinates = new Collection<float>();
			this.frontViewGridYCoordinates = new Collection<float>();
			this.backViewGridXCoordinates = new Collection<float>();
			this.backViewGridYCoordinates = new Collection<float>();
			this.frontViewContributionMap = new Collection<FrontViewDynamicContributionData>();
			this.backViewContributionMap = new Collection<BackViewDynamicContributionData>();
		}
		#endregion

		#region Public methods
		public void InitializeDefaults()
		{
			FillFrontViewDefaultGrid();
			FillBackViewDefultGrid();
			FillFrontViewContributionMapInfoDefaults();
			FillBackViewContributionMapInfoDefaults();
		}

		internal SoundMapData Clone()
		{
			SoundMapData clone = new SoundMapData();
			clone.frontViewGridXCoordinates = new Collection<float>();
			foreach (float xCoordinate in this.frontViewGridXCoordinates)
			{
				clone.frontViewGridXCoordinates.Add(xCoordinate);
			}
			clone.frontViewGridYCoordinates = new Collection<float>();
			foreach (float yCoordinate in this.frontViewGridYCoordinates)
			{
				clone.frontViewGridYCoordinates.Add(yCoordinate);
			}
			clone.backViewGridXCoordinates = new Collection<float>();
			foreach (float xCoordinate in this.backViewGridXCoordinates)
			{
				clone.backViewGridXCoordinates.Add(xCoordinate);
			}
			clone.backViewGridYCoordinates = new Collection<float>();
			foreach (float yCoordinate in this.backViewGridYCoordinates)
			{
				clone.backViewGridYCoordinates.Add(yCoordinate);
			}
			clone.frontViewContributionMap = new Collection<FrontViewDynamicContributionData>();
			foreach (FrontViewDynamicContributionData contributionData in this.frontViewContributionMap)
			{
				FrontViewDynamicContributionData clonedContributionData = contributionData.Clone();
				clone.frontViewContributionMap.Add(clonedContributionData);
			}
			clone.backViewContributionMap = new Collection<BackViewDynamicContributionData>();
			foreach (BackViewDynamicContributionData contributionData in this.backViewContributionMap)
			{
				BackViewDynamicContributionData clonedContributionData = contributionData.Clone();
				clone.backViewContributionMap.Add(clonedContributionData);
			}
			return clone;
		}

		#endregion

		#region Private methods
		private void FillFrontViewDefaultGrid()
		{
			this.frontViewGridXCoordinates.Clear();
			this.frontViewGridXCoordinates.Add(-94);
			this.frontViewGridXCoordinates.Add(-66);
			this.frontViewGridXCoordinates.Add(-31);
			this.frontViewGridXCoordinates.Add(0);
			this.frontViewGridXCoordinates.Add(34);
			this.frontViewGridXCoordinates.Add(63);
			this.frontViewGridXCoordinates.Add(91);


			this.frontViewGridYCoordinates.Clear();
			this.frontViewGridYCoordinates.Add(-10);
			this.frontViewGridYCoordinates.Add(16);
			this.frontViewGridYCoordinates.Add(37);
			this.frontViewGridYCoordinates.Add(51);
			this.frontViewGridYCoordinates.Add(71);
			this.frontViewGridYCoordinates.Add(107);
			this.frontViewGridYCoordinates.Add(150);
			this.frontViewGridYCoordinates.Add(231);
		}

		private void FillBackViewDefultGrid()
		{
			this.backViewGridXCoordinates.Clear();
			this.backViewGridXCoordinates.Add(-92);
			this.backViewGridXCoordinates.Add(-21);
			this.backViewGridXCoordinates.Add(19);
			this.backViewGridXCoordinates.Add(88);

			this.backViewGridYCoordinates.Clear();
			this.backViewGridYCoordinates.Add(0);
			this.backViewGridYCoordinates.Add(53);
			this.backViewGridYCoordinates.Add(107);
			this.backViewGridYCoordinates.Add(176);
		}

		private void FillBackViewContributionMapInfoDefaults()
		{
			this.backViewContributionMap.Clear();
			BackViewDynamicContributionData cellData1 = new BackViewDynamicContributionData();
			cellData1.InitializeDefaults();
			cellData1.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			BackViewDynamicContributionData cellData2 = new BackViewDynamicContributionData();
			cellData2.InitializeDefaults();
			cellData2.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			BackViewDynamicContributionData cellData3 = new BackViewDynamicContributionData();
			cellData3.InitializeDefaults();
			cellData3.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;

			BackViewDynamicContributionData cellData4 = new BackViewDynamicContributionData();
			cellData4.InitializeDefaults();
			cellData4.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 1f;

			BackViewDynamicContributionData cellData5 = new BackViewDynamicContributionData();
			cellData5.InitializeDefaults();
			cellData5.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			BackViewDynamicContributionData cellData6 = new BackViewDynamicContributionData();
			cellData6.InitializeDefaults();
			cellData6.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;
			
			BackViewDynamicContributionData cellData7 = new BackViewDynamicContributionData();
			cellData7.InitializeDefaults();
			cellData7.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteThree].Effect = 1f;
			
			BackViewDynamicContributionData cellData8 = new BackViewDynamicContributionData();
			cellData8.InitializeDefaults();
			cellData8.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 0.8f;
			
			BackViewDynamicContributionData cellData9 = new BackViewDynamicContributionData();
			cellData9.InitializeDefaults();
			cellData9.BackViewEffects[(int)BackViewCommonAuscultationSiteType.lungSoundSiteFive].Effect = 1f;
			

			this.backViewContributionMap.Add(cellData1);
			this.backViewContributionMap.Add(cellData2);
			this.backViewContributionMap.Add(cellData3);
			this.backViewContributionMap.Add(cellData4);
			this.backViewContributionMap.Add(cellData5);
			this.backViewContributionMap.Add(cellData6);
			this.backViewContributionMap.Add(cellData7);
			this.backViewContributionMap.Add(cellData8);
			this.backViewContributionMap.Add(cellData9);
		}

		private void FillFrontViewContributionMapInfoDefaults()
		{
			this.frontViewContributionMap.Clear();
			FrontViewDynamicContributionData cellData1 = new FrontViewDynamicContributionData();
			cellData1.InitializeDefaults();
			
			FrontViewDynamicContributionData cellData2 = new FrontViewDynamicContributionData();
			cellData2.InitializeDefaults();
			cellData2.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData3 = new FrontViewDynamicContributionData();
			cellData3.InitializeDefaults();
			cellData3.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteOne].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData4 = new FrontViewDynamicContributionData();
			cellData4.InitializeDefaults();
			cellData4.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteTwo].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData5 = new FrontViewDynamicContributionData();
			cellData5.InitializeDefaults();
			cellData5.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData6 = new FrontViewDynamicContributionData();
			cellData6.InitializeDefaults();
			
			FrontViewDynamicContributionData cellData7 = new FrontViewDynamicContributionData();
			cellData7.InitializeDefaults();
			cellData7.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			FrontViewDynamicContributionData cellData8 = new FrontViewDynamicContributionData();
			cellData8.InitializeDefaults();
			cellData8.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData9 = new FrontViewDynamicContributionData();
			cellData9.InitializeDefaults();
			cellData9.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData10 = new FrontViewDynamicContributionData();
			cellData10.InitializeDefaults();
			cellData10.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteTwo].Effect = 1f;
			
			FrontViewDynamicContributionData cellData11 = new FrontViewDynamicContributionData();
			cellData11.InitializeDefaults();
			cellData11.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteThree].Effect = 0.3f;
			cellData11.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData12 = new FrontViewDynamicContributionData();
			cellData12.InitializeDefaults();
			cellData12.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData13 = new FrontViewDynamicContributionData();
			cellData13.InitializeDefaults();
			cellData13.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.1f;
			cellData13.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData14 = new FrontViewDynamicContributionData();
			cellData14.InitializeDefaults();
			cellData14.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.6f;
			cellData14.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			FrontViewDynamicContributionData cellData15 = new FrontViewDynamicContributionData();
			cellData15.InitializeDefaults();
			cellData15.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData16 = new FrontViewDynamicContributionData();
			cellData16.InitializeDefaults();
			cellData16.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteThree].Effect = 1f;
			
			FrontViewDynamicContributionData cellData17 = new FrontViewDynamicContributionData();
			cellData17.InitializeDefaults();
			cellData17.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.8f;
			cellData17.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			FrontViewDynamicContributionData cellData18 = new FrontViewDynamicContributionData();
			cellData18.InitializeDefaults();
			cellData18.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.2f;
			cellData18.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData19 = new FrontViewDynamicContributionData();
			cellData19.InitializeDefaults();
			cellData19.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.1f;
			cellData19.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 1f;
			
			FrontViewDynamicContributionData cellData20 = new FrontViewDynamicContributionData();
			cellData20.InitializeDefaults();
			cellData20.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.3f;
			cellData20.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.7f;
			
			FrontViewDynamicContributionData cellData21 = new FrontViewDynamicContributionData();
			cellData21.InitializeDefaults();
			cellData21.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.8f;
			cellData21.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.2f;
			
			FrontViewDynamicContributionData cellData22 = new FrontViewDynamicContributionData();
			cellData22.InitializeDefaults();
			cellData22.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData23 = new FrontViewDynamicContributionData();
			cellData23.InitializeDefaults();
			cellData23.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData24 = new FrontViewDynamicContributionData();
			cellData24.InitializeDefaults();
			cellData24.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.5f;
			cellData24.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData25 = new FrontViewDynamicContributionData();
			cellData25.InitializeDefaults();
			cellData25.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.1f;
			cellData25.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData26 = new FrontViewDynamicContributionData();
			cellData26.InitializeDefaults();
			cellData26.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.4f;
			cellData26.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData27 = new FrontViewDynamicContributionData();
			cellData27.InitializeDefaults();
			cellData27.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.8f;
			cellData27.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteOne].Effect = 0.5f;
			
			FrontViewDynamicContributionData cellData28 = new FrontViewDynamicContributionData();
			cellData28.InitializeDefaults();
			cellData28.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 1f;
			
			FrontViewDynamicContributionData cellData29 = new FrontViewDynamicContributionData();
			cellData29.InitializeDefaults();
			cellData29.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 1f;
			
			FrontViewDynamicContributionData cellData30 = new FrontViewDynamicContributionData();
			cellData30.InitializeDefaults();
			cellData30.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.5f;
			cellData30.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData31 = new FrontViewDynamicContributionData();
			cellData31.InitializeDefaults();
			cellData31.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.1f;
			cellData31.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 1f;
			
			FrontViewDynamicContributionData cellData32 = new FrontViewDynamicContributionData();
			cellData32.InitializeDefaults();
			cellData32.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.3f;
			cellData32.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData33 = new FrontViewDynamicContributionData();
			cellData33.InitializeDefaults();
			cellData33.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFour].Effect = 0.8f;
			cellData33.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 0.2f;
			
			FrontViewDynamicContributionData cellData34 = new FrontViewDynamicContributionData();
			cellData34.InitializeDefaults();
			cellData34.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.8f;
			
			FrontViewDynamicContributionData cellData35 = new FrontViewDynamicContributionData();
			cellData35.InitializeDefaults();
			cellData35.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.7f;
			
			FrontViewDynamicContributionData cellData36 = new FrontViewDynamicContributionData();
			cellData36.InitializeDefaults();
			cellData36.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.5f;
			cellData36.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFour].Effect = 1f;
			
			FrontViewDynamicContributionData cellData37 = new FrontViewDynamicContributionData();
			cellData37.InitializeDefaults();
			cellData37.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.1f;
			cellData37.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 1f;
			
			FrontViewDynamicContributionData cellData38 = new FrontViewDynamicContributionData();
			cellData38.InitializeDefaults();
			cellData38.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 1f;
			
			FrontViewDynamicContributionData cellData39 = new FrontViewDynamicContributionData();
			cellData39.InitializeDefaults();
			cellData39.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.9f;
			cellData39.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteTwo].Effect = 0.5f;
			
			FrontViewDynamicContributionData cellData40 = new FrontViewDynamicContributionData();
			cellData40.InitializeDefaults();
			cellData40.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.6f;
			
			FrontViewDynamicContributionData cellData41 = new FrontViewDynamicContributionData();
			cellData41.InitializeDefaults();
			cellData41.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.heartSoundSiteFive].Effect = 0.4f;
			cellData41.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFive].Effect = 1f;
			
			FrontViewDynamicContributionData cellData42 = new FrontViewDynamicContributionData();
			cellData42.InitializeDefaults();
			cellData42.FrontViewEffects[(int)FrontViewCommonAuscultationSiteType.lungSoundSiteFive].Effect = 1f;
			

			this.frontViewContributionMap.Add(cellData1);
			this.frontViewContributionMap.Add(cellData2);
			this.frontViewContributionMap.Add(cellData3);
			this.frontViewContributionMap.Add(cellData4);
			this.frontViewContributionMap.Add(cellData5);
			this.frontViewContributionMap.Add(cellData6);
			this.frontViewContributionMap.Add(cellData7);
			this.frontViewContributionMap.Add(cellData8);
			this.frontViewContributionMap.Add(cellData9);
			this.frontViewContributionMap.Add(cellData10);
			this.frontViewContributionMap.Add(cellData11);
			this.frontViewContributionMap.Add(cellData12);
			this.frontViewContributionMap.Add(cellData13);
			this.frontViewContributionMap.Add(cellData14);
			this.frontViewContributionMap.Add(cellData15);
			this.frontViewContributionMap.Add(cellData16);
			this.frontViewContributionMap.Add(cellData17);
			this.frontViewContributionMap.Add(cellData18);
			this.frontViewContributionMap.Add(cellData19);
			this.frontViewContributionMap.Add(cellData20);
			this.frontViewContributionMap.Add(cellData21);
			this.frontViewContributionMap.Add(cellData22);
			this.frontViewContributionMap.Add(cellData23);
			this.frontViewContributionMap.Add(cellData24);
			this.frontViewContributionMap.Add(cellData25);
			this.frontViewContributionMap.Add(cellData26);
			this.frontViewContributionMap.Add(cellData27);
			this.frontViewContributionMap.Add(cellData28);
			this.frontViewContributionMap.Add(cellData29);
			this.frontViewContributionMap.Add(cellData30);
			this.frontViewContributionMap.Add(cellData31);
			this.frontViewContributionMap.Add(cellData32);
			this.frontViewContributionMap.Add(cellData33);
			this.frontViewContributionMap.Add(cellData34);
			this.frontViewContributionMap.Add(cellData35);
			this.frontViewContributionMap.Add(cellData36);
			this.frontViewContributionMap.Add(cellData37);
			this.frontViewContributionMap.Add(cellData38);
			this.frontViewContributionMap.Add(cellData39);
			this.frontViewContributionMap.Add(cellData40);
			this.frontViewContributionMap.Add(cellData41);
			this.frontViewContributionMap.Add(cellData42);
		}
		#endregion
	}
}
